import { Drash } from './dep.ts';
import { Resources } from './src/liv/modules/mod.ts';

const server = new Drash.Http.Server({
  response_output: "text/html",
  // response_output: 'application/json',
  resources: Resources,
  middleware: {
    before_request: [(req: any) => {
      const { url_query_params } = req;
      console.log({ url_query_params });
    }]
    // ,
    // after_request: [
    //   (req: any, res: any) => {
    //     const data = res.body;
    //     res.body = JSON.stringify({
    //       code: 0,
    //       data,
    //       msg: 'ok'
    //     });
    //   }
    // ]
  }
});

server.run({
  hostname: "localhost",
  port: 22580
});
console.log("Server listening: http://localhost:22580");